-- GENERATED SPELL FOR [Ethereum Archon] --


function spell0_20458(pUnit, Event) --@Energy Flux,Self--
pUnit:FullCastSpellOnTarget(35924,pUnit)
pUnit:RegisterEvent('Sorts_20458', 8000, 1)
end

function spell1_20458(pUnit, Event) --@Intangible Presence,n/a--
pUnit:FullCastSpellOnTarget(36513,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20458', 8338, 1)
end

function spell2_20458(pUnit, Event) --@Overspark,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(35579,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_20458', 1, 1)
end

function spell3_20458(pUnit, Event) --@Shadowsurge,n/a--
pUnit:FullCastSpellOnTarget(36517,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20458', 526, 1)
end

function spell4_20458(pUnit, Event) --@Shadowtouched,Self--
pUnit:FullCastSpellOnTarget(36515,pUnit)
pUnit:RegisterEvent('Sorts_20458', 644, 1)
end

function Sorts_20458(pUnit, Event)
local choix_sorts_20458 = math.random(0, 4)
if choix_sorts_20458 == 0 then
pUnit:RegisterEvent('spell0_20458', 1, 1)
end
if choix_sorts_20458 == 1 then
pUnit:RegisterEvent('spell1_20458', 1, 1)
end
if choix_sorts_20458 == 2 then
pUnit:RegisterEvent('spell2_20458', 1, 1)
end
if choix_sorts_20458 == 3 then
pUnit:RegisterEvent('spell3_20458', 1, 1)
end
if choix_sorts_20458 == 4 then
pUnit:RegisterEvent('spell4_20458', 1, 1)
end
end

function mob20458_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20458', math.random(1500, 3000), 1)
end

function mob20458_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20458_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20458_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20458, 1, 'mob20458_Action')
RegisterUnitEvent(20458, 2, 'mob20458_Leave')
RegisterUnitEvent(20458, 3, 'mob20458_Kill')
RegisterUnitEvent(20458, 4, 'mob20458_Die')
